import Main from '@/views/layout/Main'
import Login from '@/views/Login' 

// 不作为Main组件的子页面展示的页面
export const loginRouter = {
    path: '/login',
    name: '登录',
    component: resolve => { require(['@/views/Login'], resolve); },
    meta:{isLogin:false,isAuth:false,title:'员工管理'+titleMain},
};
export const page404Router = {
    path: '*',
    name: '404',
    component: resolve => { require(['@/views/404'], resolve); },
    meta:{isLogin:false,isAuth:false,title:'404'+titleMain}
}; 

const titleMain = '|资产管理系统'
//作为Main组件的子页面展示的页面
export const appRouter=[
    {
    	path:'/',
    	name:'系统',
    	component:Main,
    	children:[
        	{path:'/',redirect:{path:'/index'}},
            {path:'/message',name:'消息显示页',component:resolve=>{require(['@/views/Message'],resolve);},meta:{isLogin:true,isAuth:true,title:'消息'+titleMain}},
            {path:'/index',name:'首页',component:resolve=>{require(['@/views/Dashboard'],resolve);},meta:{isLogin:true,isAuth:true,title:'首页'+titleMain}},
            {path:'/staticasset/inbound',name:'入库管理',component:resolve=>{require(['@/views/system/staticassets/inbound/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'新增入库'+titleMain}},
            {path:'/staticasset/assign',name:'领用管理',component:resolve=>{require(['@/views/system/staticassets/assign/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'领用管理'+titleMain}},
            {path:'/staticasset/list',name:'资产列表',component:resolve=>{require(['@/views/system/staticassets/assets/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'资产列表'+titleMain}},
            {path:'/setting/user',name:'用户管理',component:resolve=>{require(['@/views/system/usermanage/user/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'用户管理'+titleMain}},
            {path:'/setting/role',name:'角色管理',component:resolve=>{require(['@/views/system/usermanage/role/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'角色管理'+titleMain}},
            {path:'/setting/group',name:'组织架构',component:resolve=>{require(['@/views/system/employee/group/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'组织架构'+titleMain}},
            {path:'/setting/employee',name:'员工管理',component:resolve=>{require(['@/views/system/employee/employees/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'员工管理'+titleMain}},
            {path:'/staticasset/area',name:'区域管理',component:resolve=>{require(['@/views/system/staticassets/area/AreaTable'],resolve);},meta:{isLogin:true,isAuth:true,title:'区域管理'+titleMain}},
            {path:'/staticasset/classify',name:'分类管理',component:resolve=>{require(['@/views/system/staticassets/classify/ClassifyTreeTable'],resolve);},meta:{isLogin:true,isAuth:true,title:'分类管理'+titleMain}},
            {path:'/staticasset/backbound',name:'退库管理',component:resolve=>{require(['@/views/system/staticassets/outassign/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'员工管理'+titleMain}},
            {path:'/staticasset/infos',name:'资产条目管理',component:resolve=>{require(['@/views/system/staticassets/assetInfo/Container'],resolve);},meta:{isLogin:true,isAuth:true,title:'资产条目管理'+titleMain}},
            {path:'/staticasset/useinfo',name:'员工使用',component:resolve=>{require(['@/views/system/staticassets/useinfo/EmployeeUseInfoTable'],resolve);},meta:{isLogin:true,isAuth:true,title:'员工使用'+titleMain}},
            {path:'/staticasset/check',
                name:'盘点管理',
                component:resolve=>{require(['@/views/system/staticassets/check/Container'],resolve);},
                children:[
                    { path: '',name:'盘点管理', component:resolve=>{require(['@/views/system/staticassets/check/AssetsCheckTable'],resolve); }},
                    { path: 'addCheck',name:'创建盘点', component:resolve=>{require(['@/views/system/staticassets/check/AddCheck'],resolve); }}
                ],
                meta:{isLogin:true,isAuth:true,title:'盘点管理'+titleMain}
            }
    	]
    }
];

//导出
export const routers=[
    loginRouter,
    ...appRouter,
    page404Router
];
